package javaBase.chapter02.cse;

/**
 * 变量的作用域
 */
public class case2_2_4 {
    public static void main(String[] args){
        int x = 12;
        {
            int y = 36; //y的作用域和生命周期仅在此代码块有效
            System.out.println("x is " + x);
            System.out.println("y is " + y);
        }
        int y = x;
        System.out.println("x is " + x);
        System.out.println("y is " + y);
    }
}
